package com.leha.forum.lehare.controller;

import com.leha.forum.lehare.response.Result;
import com.leha.forum.lehare.service.NotificationService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @author lovelycat
 * @version 1.0
 * @since 2025-04-27 21:43
 */
@RestController
@RequestMapping("/notification")
public class NotificationController {
    @Resource
    private NotificationService notificationService;

    @GetMapping("/user")
    public Result<?> getUserNotifications(Principal principal) {
        return Result.success("", notificationService.getUserNotifications(Long.valueOf(principal.getName())));
    }
}
